package dongbu.bo.overtime;

import glorial.connection.ConnectionKey;

import java.math.BigDecimal;
import java.util.List;

import dongbu.bo.BaseBO;
import dongbu.dao.overtime.OverTimeDAO;
import dongbu.vo.overtime.OverTimeChild;

public class OverTimeBO extends BaseBO{
	
	public List getOverTimeChildList(){
		OverTimeDAO dao = new OverTimeDAO();
		return dao.getOverTimeChildList();
	}
	
	public void createOverTimeChild(OverTimeChild record) throws Exception{
		OverTimeDAO dao = new OverTimeDAO();
		
		ConnectionKey ckey = this.beginTransaction();
		
		try{
			BigDecimal newId = dao.getOverTimeChildPrimaryKey(ckey);
			System.out.println(newId);
			record.setId(newId);
			int cnt = dao.createOverTimeChild(ckey, record);
			if(cnt > 0){
				this.commitTransaction(ckey);
			}
		}catch(Exception e){
			e.printStackTrace();
			this.rollbackTransaction(ckey);
		}finally{
			this.endTransaction(ckey);
		}
	}
}
